import { request } from 'umi';

export async function fakeSubmitForm(params: any) {
  return request('/api/hospital/save', {
    method: 'POST',
    data: params,
  });
}

export async function queryDetail(params: any) {
  return request('/api/hospital/' + params.id, {
    method: 'get',
    data: params,
  });
}

export async function queryProvince(params: any) {
  return request('/api/bsArea/tree', {
    method: 'POST',
    data: params,
  });
}

export async function updateSort(params: any) {
  return request('/api/hospitalAttestation/updateById', {
    method: 'PUT',
    data: params,
  });
}


export async function authlist(params: any) {
  return request('/api/hospitalAttestation/page', {
    method: 'POST',
    data: params,
  });
}

export async function queryAuthHospitalDetail(params: any) {
  return request('/api/hospitalAttestation/' + params.id, {
    method: 'get',
    data: params,
  });
}

export async function approveHospital(params: any) {
  return request('/api/hospitalAttestation/reviewHospitalAttestation', {
    method: 'POST',
    data: params,
  });
}

export async function updateTop(params: any) {
  return request('/api/hospital/isTop', {
    method: 'POST',
    data: params,
  });
}

export async function update(params: any) {
  return request('/api/hospital/updateById', {
    method: 'PUT',
    data: params,
  });
}

export async function remove(data: { key: number[] }, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/hospital/' + data.key, {
    data,
    method: 'DELETE',
    ...(options || {}),
  });
}
